package cn.itsource.feign.clients;

import cn.itsource.domain.User;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class PayFallBackFactory implements FallbackFactory<UserFeignClient> {
    @Override
    public UserFeignClient create(Throwable throwable) {
        return new UserFeignClient() {
            @Override
            public User getUser(long id) {
                return new User(-1L,"pay失败了","失败了弟弟");
            }
        };
    }
}
